PROJECT_PATH=~/workspace/VisionSpice
ANDROID_NDK_ROOT=~/android-ndk-r5c
JNI_PATH=$(PROJECT_PATH)/jni
SOURCE_PATH=$(PROJECT_PATH)/src
PACKAGE=com.android.vspice
INTERFACE_FILE=VSpice.i

all: 
	$(ANDROID_NDK_ROOT)/ndk-build

swig:
	rm -rf $(SOURCE_PATH)/$(subst .,/,$(PACKAGE))/swig/* 
	swig2.0 -c++ -java -package $(PACKAGE).swig \
		-o $(JNI_PATH)/$(INTERFACE_FILE:.i=_wrap.cpp) \
		-outdir $(SOURCE_PATH)/$(subst .,/,$(PACKAGE))/swig \
		$(JNI_PATH)/$(INTERFACE_FILE)

clean:
	$(ANDROID_NDK_ROOT)/ndk-build clean
